class Event{
  constructor(){

  }
  on(evt,fn){
    if(typeof this.#listeners[evt] === 'undefined'){
      this.#listeners[evt] = [];
    }
    this.#listeners[evt].push(fn);
  }
  emmit(evt,arg){
    const fns = this.#listeners[evt];
    for(const fn of fns){
      fn();
    }
  }
  #listeners = {
    'bark':[fn1,fn2],
    'hello':[fn3,fn4]
  };
}
